package cn.com.zpark.servlet_request;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @PackageName: cn.com.zpark.servlet_request
 * @ClassName: ServletRequestDemo06
 * @Description:
 * @author: RZS
 * @date: 2021/11/14  7:56
 */
@WebServlet("/srd6.do")
public class ServletRequestDemo06 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        /**
         * 将请求转发到登录页面
         */
        // 获取转发器
        RequestDispatcher requestDispatcher = request.getRequestDispatcher("/Servlet_Request/view/index.html");
        // 调用方法转发
        requestDispatcher.forward(request, response);
    }
}
